<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Fourier descriptors</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Fourier descriptors<div class="ingroups"><a class="el" href="../../df/d2d/group__ximgproc.html">Extended Image Processing</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html">cv::ximgproc::ContourFitting</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Class for <a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html" title="Class for ContourFitting algorithms. ContourFitting match two contours  and  minimizing distance  whe...">ContourFitting</a> algorithms. <a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html" title="Class for ContourFitting algorithms. ContourFitting match two contours  and  minimizing distance  whe...">ContourFitting</a> match two contours \( z_a \) and \( z_b \) minimizing distance </td></tr></table></div></body></html><p class="formulaDsp">
\[ d(z_a,z_b)=\sum (a_n - s b_n e^{j(n \alpha +\phi )})^2 \]
</p>
<p> where \( a_n \) and \( b_n \) are Fourier descriptors of \( z_a \) and \( z_b \) and s is a scaling factor and \( \phi \) is angle rotation and \( \alpha \) is starting point factor adjustement.  <a href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html#details">More...</a><br/></p>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga7f51db9e952d4292a3b80bcc12b9fec9"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/ddc/group__ximgproc__fourier.html#ga7f51db9e952d4292a3b80bcc12b9fec9">cv::ximgproc::contourSampling</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> out, int nbElt)</td></tr>
<tr class="memdesc:ga7f51db9e952d4292a3b80bcc12b9fec9"><td class="mdescLeft"> </td><td class="mdescRight">Contour sampling .  <a href="../../dd/ddc/group__ximgproc__fourier.html#ga7f51db9e952d4292a3b80bcc12b9fec9">More...</a><br/></td></tr>
<tr class="separator:ga7f51db9e952d4292a3b80bcc12b9fec9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadddbddafbb6eb9795246371772924c7c"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html">ContourFitting</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/ddc/group__ximgproc__fourier.html#gadddbddafbb6eb9795246371772924c7c">cv::ximgproc::createContourFitting</a> (int ctr=1024, int fd=16)</td></tr>
<tr class="memdesc:gadddbddafbb6eb9795246371772924c7c"><td class="mdescLeft"> </td><td class="mdescRight">create <a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html" title="Class for ContourFitting algorithms. ContourFitting match two contours  and  minimizing distance  whe...">ContourFitting</a> algorithm object  <a href="../../dd/ddc/group__ximgproc__fourier.html#gadddbddafbb6eb9795246371772924c7c">More...</a><br/></td></tr>
<tr class="separator:gadddbddafbb6eb9795246371772924c7c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac929d241e37cc33fdb59969d1b197dd2"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/ddc/group__ximgproc__fourier.html#gac929d241e37cc33fdb59969d1b197dd2">cv::ximgproc::fourierDescriptor</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int nbElt=-1, int nbFD=-1)</td></tr>
<tr class="memdesc:gac929d241e37cc33fdb59969d1b197dd2"><td class="mdescLeft"> </td><td class="mdescRight">Fourier descriptors for planed closed curves.  <a href="../../dd/ddc/group__ximgproc__fourier.html#gac929d241e37cc33fdb59969d1b197dd2">More...</a><br/></td></tr>
<tr class="separator:gac929d241e37cc33fdb59969d1b197dd2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga95f303288dac0e02ab3777b603933921"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/ddc/group__ximgproc__fourier.html#ga95f303288dac0e02ab3777b603933921">cv::ximgproc::transformFD</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> t, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, bool fdContour=true)</td></tr>
<tr class="memdesc:ga95f303288dac0e02ab3777b603933921"><td class="mdescLeft"> </td><td class="mdescRight">transform a contour  <a href="../../dd/ddc/group__ximgproc__fourier.html#ga95f303288dac0e02ab3777b603933921">More...</a><br/></td></tr>
<tr class="separator:ga95f303288dac0e02ab3777b603933921"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga7f51db9e952d4292a3b80bcc12b9fec9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f51db9e952d4292a3b80bcc12b9fec9">◆ </a></span>contourSampling()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::ximgproc::contourSampling </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nbElt</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>out</td><td>=</td><td>cv.ximgproc.contourSampling(</td><td class="paramname">src, nbElt[, out]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../db/d75/fourier__descriptors_8hpp.html">opencv2/ximgproc/fourier_descriptors.hpp</a>&gt;</code></p>
<p>Contour sampling . </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>contour type vector&lt;Point&gt; , vector&lt;Point2f&gt; or vector&lt;Point2d&gt; </td></tr>
    <tr><td class="paramname">out</td><td><a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a> of type CV_64FC2 and nbElt rows </td></tr>
    <tr><td class="paramname">nbElt</td><td>number of points in out contour </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gadddbddafbb6eb9795246371772924c7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadddbddafbb6eb9795246371772924c7c">◆ </a></span>createContourFitting()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html">ContourFitting</a>&gt; cv::ximgproc::createContourFitting </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ctr</em> = <code>1024</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>fd</em> = <code>16</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ximgproc.createContourFitting(</td><td class="paramname">[, ctr[, fd]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../db/d75/fourier__descriptors_8hpp.html">opencv2/ximgproc/fourier_descriptors.hpp</a>&gt;</code></p>
<p>create <a class="el" href="../../d5/d72/classcv_1_1ximgproc_1_1ContourFitting.html" title="Class for ContourFitting algorithms. ContourFitting match two contours  and  minimizing distance  whe...">ContourFitting</a> algorithm object </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctr</td><td>number of Fourier descriptors equal to number of contour points after resampling. </td></tr>
    <tr><td class="paramname">fd</td><td>Contour defining second shape (Target). </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gac929d241e37cc33fdb59969d1b197dd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac929d241e37cc33fdb59969d1b197dd2">◆ </a></span>fourierDescriptor()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::ximgproc::fourierDescriptor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nbElt</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>nbFD</em> = <code>-1</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.ximgproc.fourierDescriptor(</td><td class="paramname">src[, dst[, nbElt[, nbFD]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../db/d75/fourier__descriptors_8hpp.html">opencv2/ximgproc/fourier_descriptors.hpp</a>&gt;</code></p>
<p>Fourier descriptors for planed closed curves. </p>
<p>For more details about this implementation, please see <a class="el" href="../../d0/de3/citelist.html#CITEREF_PersoonFu1977">[198]</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>contour type vector&lt;Point&gt; , vector&lt;Point2f&gt; or vector&lt;Point2d&gt; </td></tr>
    <tr><td class="paramname">dst</td><td><a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a> of type CV_64FC2 and nbElt rows A VERIFIER </td></tr>
    <tr><td class="paramname">nbElt</td><td>number of rows in dst or getOptimalDFTSize rows if nbElt=-1 </td></tr>
    <tr><td class="paramname">nbFD</td><td>number of FD return in dst dst = [FD(1...nbFD/2) FD(nbFD/2-nbElt+1...:nbElt)] </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga95f303288dac0e02ab3777b603933921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga95f303288dac0e02ab3777b603933921">◆ </a></span>transformFD()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::ximgproc::transformFD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>fdContour</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.ximgproc.transformFD(</td><td class="paramname">src, t[, dst[, fdContour]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../db/d75/fourier__descriptors_8hpp.html">opencv2/ximgproc/fourier_descriptors.hpp</a>&gt;</code></p>
<p>transform a contour </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>contour or Fourier Descriptors if fd is true </td></tr>
    <tr><td class="paramname">t</td><td>transform <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a> given by estimateTransformation </td></tr>
    <tr><td class="paramname">dst</td><td><a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a> of type CV_64FC2 and nbElt rows </td></tr>
    <tr><td class="paramname">fdContour</td><td>true src are Fourier Descriptors. fdContour false src is a contour </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:42 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>


